//index.js
//获取应用实例
const app = getApp()

Page({
    data: {
        motto: 'Hello World',
        userInfo: {},
        hasUserInfo: false,
        canIUse: wx.canIUse('button.open-type.getUserInfo')
    },
    //事件处理函数
    bindViewTap: function() {
        wx.navigateTo({
        url: '../logs/logs'
        })
    },
    onLoad: function () {
        let that = this;
        var userInfo = wx.getStorageSync("userinfo");
        console.log(userInfo);
        if (userInfo) {
            that.setData({
                url: "https://xindian.jmodata.com/phone_mall_mw/pages/index.html?userID=" + userInfo.userID,
                userID: userInfo.userID
            })
            
        } else {
            wx.redirectTo({
                url: '../login/login'
            })
        }
    },
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function (res) {
    },
    
})
